﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="qlmain.ascx.cs" Inherits="admin_qlmain" %>
<script>
    function confirmDelete() {
        var agree = confirm("Bạn thật sự muốn xóa dữ liệu này?");
        if (agree)
            return true;
        else
            return false;
    }
</script>
<br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" AllowSorting="True"
        CellPadding="4" ForeColor="#333333" GridLines="None"
        PageSize="5" Width="100%" onrowcreated="GridView1_RowCreated" 
        onrowediting="GridView1_RowEditing" 
    onrowcommand="GridView1_RowCommand" DataKeyNames="id,lang" 
    DataSourceID="SqlDataSource1">
        <RowStyle BackColor="#EFF3FB" VerticalAlign="Middle" />
        <EmptyDataRowStyle VerticalAlign="Middle" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="#459300" HorizontalAlign="Center" />
        <EmptyDataTemplate>
             <asp:Label ID="Label3" runat="server" Text="Chưa có dữ liệu"></asp:Label>
        </EmptyDataTemplate>
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#57A000" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="ID" SortExpression="id" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:Label ID="id" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="id" runat="server" Text='<%# Bind("id") %>'></asp:Label>
                </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ngôn ngữ" SortExpression="lang" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:Label ID="lang" runat="server" Text='<%# Eval("lang") %>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lang" runat="server" Text='<%# Bind("lang") %>'></asp:Label>
                </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Menu" SortExpression="menu" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("menu") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("menu") %>'></asp:Label>
                </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tiêu đề" SortExpression="title" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("title") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("title") %>'></asp:Label>
                </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" ItemStyle-HorizontalAlign="Center" 
                ButtonType="Button" EditText="Chỉnh sửa">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:CommandField>
        </Columns>
        <EditRowStyle BackColor="#003366" VerticalAlign="Middle" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
    SelectCommand="SELECT * FROM [Main]"></asp:SqlDataSource>